﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Windows.WorkFlow.Domain;

namespace Windows.WorkFlow.Infrastructure.EFCore.Mappings
{
    public class ExecutionMapping : IEntityTypeConfiguration<Execution>
    {
        public void Configure(EntityTypeBuilder<Execution> builder)
        {
            builder.Property(x => x.PId).IsRequired(false);
            builder.Property(x => x.NodeId).HasMaxLength(50);
            builder.Property(x => x.NodeName).HasMaxLength(50);
            builder.Property(x => x.NodeType).HasMaxLength(50);
            builder.Property(x => x.StartOn).HasColumnType("datetime");
            builder.Property(x => x.EndOn).IsRequired(false).HasColumnType("datetime");
            builder.Property(x => x.FlowInstanceId);
        }
    }
}
